package com.wtwd.campus.jdzc.dao;

import com.wtwd.campus.entity.FenceInfo;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: ldaoliang
 * @DateTime: 2022/2/15 10:11
 * @Description:
 */
@Mapper
@Repository("jdzcFenceInfoMapper")  // 解决重名问题
public interface FenceInfoMapper {
    /**
     *根据学生id查询围栏
     */
    List<FenceInfo> getJdzcFenceInfoListByStuId(@Param("stuId") Integer stuId);

    /**
     * 根据学生id和围栏名称查询围栏
     * @param stuId
     * @param fenceName
     * @return
     */
    FenceInfo getJdzcFenceInfoByStuIdAndFenceName(@Param("stuId") Integer stuId, @Param("fenceName") String fenceName);

    /**
     * 添加围栏
     * @param fenceInfo
     * @return
     */
    Integer addFence(@Param("fenceInfo") FenceInfo fenceInfo);

    /**
     * 根据围栏id获取围栏信息
     * @param fenceId
     * @return
     */
    FenceInfo getJdzcFenceInfoByFenceId(int fenceId);

    /**
     * 删除围栏信息
     * @param fenceId
     * @return
     */
    Integer deleteFenceIfo(@Param("fenceId") Integer fenceId);

    /**
     * 修改围栏信息
     * @param fenceInfo
     * @return
     */
    Integer modifyFenceInfo(@Param("fenceInfo") FenceInfo fenceInfo);
}
